
#ifndef __DXDRAWENV_H__
#define	__DXDRAWENV_H__

#include <ddraw.h>    // directX includes

typedef struct _DxDrawEnv
{
	// notice that interface 7.0 is used on a number of interfaces
	LPDIRECTDRAW7			m_lpdd;				// dd object
	LPDIRECTDRAWSURFACE7	m_lpddsprimary;		// dd primary surface
	LPDIRECTDRAWSURFACE7	m_lpddsback;		// dd back surface
	LPDIRECTDRAWPALETTE		m_lpddpal;			// a pointer to the created dd palette
	LPDIRECTDRAWCLIPPER		m_lpddclipper;		// dd clipper for back surface
	LPDIRECTDRAWCLIPPER		m_lpddclipperwin;	// dd clipper for window

	PALETTEENTRY			m_palette[MAX_COLORS_PALETTE];         // color palette
	PALETTEENTRY			m_save_palette[MAX_COLORS_PALETTE];    // used to save palettes
	DDSURFACEDESC2			m_ddsd;								// a direct draw surface description struct
	//DDBLTFX              ddbltfx;					// used to fill
	DDSCAPS2				m_ddscaps;              // a direct draw surface capabilities struct
	//HRESULT              ddrval;					// result back from dd calls
	UCHAR *					m_primary_buffer;		// primary video buffer
	UCHAR *					m_back_buffer;			// secondary back buffer
	int						m_primary_lpitch;		// memory line pitch for primary buffer
	int						m_back_lpitch;			// memory line pitch for back buffer


	int						m_dd_pixel_format;					// default pixel format

	HWND					m_hWnd;
	int						m_WndWidth;
	int						m_WndHeight;
	int						m_bpp;
	BOOL					m_bFullScreen;

	// these defined the general clipping rectangle
	int						m_min_clip_x;                       // clipping rectangle 
	int						m_max_clip_x; 
	int						m_min_clip_y; 
	int						m_max_clip_y; 
}DxDrawEnv, *PDxDrawEnv;

#endif